<!--  -->
<template>
  <div class="area">
    <div class="header">
      <van-icon name="arrow-left" size="18" @click="goBack()" />
      <p>价格筛选</p>
      <span></span>
    </div>
    <div class="content">
      <div class="search">
        <select name="" id="">
          <option value="">北京</option>
          <option value="">上海</option>
          <option value="">深圳</option>
        </select>
        <van-search
          v-model="search"
          placeholder="请在这里输入区域/商圈"
          @search="onSearch"
          right-icon="search"
          left-icon=""
        />
        <p @click="gofindHome()">地图找房</p>
      </div>
      <div class="classify">
        <ul>
          <li @click="goArea()">
            区域<van-icon name="arrow-down" size="13" />
          </li>
          <li class="active">价格<van-icon name="arrow-down" size="13" /></li>
          <li @click="gohouseType()">
            户型<van-icon name="arrow-down" size="13" />
          </li>
          <li @click="goScreen()">
            筛选<van-icon name="arrow-down" size="13" />
          </li>
          <li><van-icon name="sort" /></li>
        </ul>
      </div>
      <div class="condition">
        <p>不限</p>
        <p>≤10万</p>
        <p>20万-30万</p>
        <p>30万-50万</p>
        <p>50万-100万</p>
        <p>≥1000万</p>
        <van-divider />
        <van-slider
          v-model="value"
          range
          @change="onChange"
          active-color="orangered"
          min="1000000"
          max="10000000"
        />
      </div>
    </div>
    <div class="btn">
      <button @click="goBack()">确定</button>
    </div>
  </div>
</template>

<script>
import { Toast } from "vant";
import Button from "../../components/Button.vue";
export default {
  components: {
    Button,
  },
  // 组件状态值
  data() {
    return {
      search: "",
      value: [1000000, 10000000],
    };
  },
  // 计算属性
  computed: {},
  // 组件方法
  methods: {
    //返回二手房界面
    goBack() {
      this.$router.push("/resoldHome");
    },
    //跳转到区域筛选页面
    goArea() {
      this.$router.push("/area");
    },
    //跳转到户型筛选页面
    gohouseType() {
      this.$router.push("/houseType");
    },
    //跳转型筛选页面
    goScreen() {
      this.$router.push("/screen");
    },
    //跳转到地图找房页面
    gofindHome() {
      this.$router.push("/findHome");
    },
    //搜索
    onSearch() {},
    //滑块
    onChange(value) {
      Toast("当前值：" + value);
    },
  },
  /**
   * 组件实例创建完成，属性已绑定，但DOM还未生成，$ el属性还不存在
   */
  created() {},
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<!--使用了scoped属性之后，父组件的style样式将不会渗透到子组件中，-->
<!--然而子组件的根节点元素会同时被设置了scoped的父css样式和设置了scoped的子css样式影响，-->
<!--这么设计的目的是父组件可以对子组件根元素进行布局。-->
<style lang="scss" scoped>
.area {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.header {
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  color: #fff;
  background: #4381e6;
  padding: 0 15px;
}
.content {
  width: 100%;
  height: 100%;
}
.search {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  .van-search__content {
    border: 1px solid #ddd;
  }
  select {
    width: 55px;
    border: 0;
    outline: 0;
  }
  p {
    font-size: 15px;
  }
}
.classify {
  width: 100%;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  ul {
    display: flex;
    justify-content: space-around;
    line-height: 40px;
    .van-icon {
      margin-left: 3px;
    }
    .active {
      color: orange;
    }
  }
}
.condition {
  width: 100%;
  text-align: center;
  line-height: 50px;
  color: #999;
  p:nth-child(1) {
    margin-top: 30px;
  }
}
.btn {
  width: 100%;
  button {
    width: 100%;
    height: 50px;
    background: red;
    color: #fff;
    border: 0;
  }
}
</style>
